<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn>
    <span>我是span替换slot</span>
  </cpn>
  <cpn></cpn>
</div>
<template id="cpn">
  <div>
    <h2>我是组件cpn</h2>
    <p>哈哈</p>
    <slot>
      <span>我是slot的默认内容</span>
    </slot>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  const app=new Vue({
    el: '#app',
    data: {
      message:'你好vue',
    },
    components:{
      cpn:{
        template: '#cpn',
      }
    }
  })
</script>
</body>
</html>